package main

import (
	"fmt"
	"time"
)

func main() {
	//once()
	schedule()
}

func once() {
	timer := time.NewTimer(time.Second * 3)

	<-timer.C
	fmt.Println("3s倒时")
}

func schedule() {
	ticker := time.NewTicker(time.Second * 3)
	num := 5
	for {
		<-ticker.C
		num--
		println(num)
		if num == 0 {
			break
		}
	}
	println("发射火箭")
}
